import axios from '@/utils/request'

import config from '@/common/config'

let base = config.getMkBasePath();
let mall = config.getMallmBasePath();


/**
 * 商品秒杀表
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={id:'主键ID 主键',seckillTime:'秒杀有效的时间（单位为秒），默认时间为一天，即86400秒',startTime:'开始秒杀时间',endTime:'秒杀到期时间',isOpen:'商品秒杀状态0关闭，1开启，默认为1',isNumScope:'是否控制数量0关闭，1控制，默认为0',locationId:'门店ID',shopId:'商铺ID',isAnonymous:'是否开启匿名团：1是',cuserid:'创建人',cdate:'创建时间',lopuserid:'最后操作人',lopcreate:'最后操作时间',name:'秒杀名称',des:'秒杀描述',shippingFree:'活动包邮',reduceType:'优惠类型：1',copyActivityId:'拷贝自秒杀ID'}
 **/
 
//普通查询 条件之间and关系  
export const listSeckillActivity = params => { return axios.get(`${base}/mk/seckill/seckillActivity/list`, { params: params }); };

//模糊查询商品秒杀表 条件之间or关系  
//export const listSeckillActivityKey = params => { return axios.get(`${base}/mk/seckill/seckillActivity/listKey`, { params: params }); };

//删除一条商品秒杀表 params={id:'主键ID 主键'}
export const delSeckillActivity = params => { return axios.post(`${base}/mk/seckill/seckillActivity/del`,params); };

//批量删除商品秒杀表  params=[{id:'主键ID 主键'}]
export const batchDelSeckillActivity = params => { return axios.post(`${base}/mk/seckill/seckillActivity/batchDel`, params); };

//修改一条商品秒杀表记录
export const editSeckillActivity = params => { return axios.post(`${base}/mk/seckill/seckillActivity/edit`, params); };

//新增一条商品秒杀表
export const addSeckillActivity = params => { return axios.post(`${base}/mk/seckill/seckillActivity/add`, params); };

//查询所有的门店
export const listShopLocation = params => { return axios.get(`${mall}/mallm/shop/shopLocation/list`, { params: params }); };

//prgress-step
export const addSeckillActivityAll = params => { return axios.post(`${base}/mk/seckill/seckillActivity/step`, params); };

export const stepExt= params => { return axios.post(`${base}/mk/seckill/seckillActivity/stepExt`, params); };

export const listSeckillActivityByActivityIdAndCopyActivityId = params => { return axios.get(`${base}/mk/seckill/seckillActivity/listbyactivityid`, { params: params }); };


